import { post, get } from '@/request/useRequest'
import { UserInfo} from './typing';
import { ResponseBody } from '@/api/typing';

export interface LoginParams {
  username: string;
  password: string;
  [key: string]: any
}

export async function login(params: LoginParams): Promise<ResponseBody<UserInfo>> {
  return post('user/login', null, params);
}

export async function loginsso(params: LoginParams): Promise<ResponseBody<UserInfo>> {
  return post('user/loginsso', null, params);
}

export async function getCurrentUser(): Promise<ResponseBody<UserInfo>> {
  return get('user/getCurrentUser');
}

/*export async function postLogout(): Promise<any> {
  return request.post('/logout');
}

export async function getSmsCaptcha(params: SmsCaptchaRequest): Promise<any> {
  request.get('/message/captcha/sms', {
    params,
  });
}*/
